#include "UdpServer.hpp"

void Usage(const std::string& str)
{
    std::cout << "Usage:" << str << " local_port" << std::endl;
}
int main(int argc,char* argv[])
{
    // if(argc != 3)
    // {
    //     Usage(argv[0]);
    //     exit(1);
    // }
    if(argc != 2)
    {
        Usage(argv[0]);
        exit(1);
    }
    EnableConsoleLogStrategy();//启动日志
    // UdpServer server(argv[1],(uint16_t)std::stoi(argv[2]));
    std::unique_ptr<UdpServer> server = std::make_unique<UdpServer>((uint16_t)std::stoi(argv[1]));
    server->Init();
    server->Start();
    return 0;
}
